if %1 == /f goto :0
if %1 == /d goto :1
if %1 == /g goto :2
goto :out

:0
clnutils /i
find /i /c "%2" %3 | sort /R >> %temp%\pininst.bat
call %temp%\pininst.bat

set pintemp=---------- %3: 0

rem set
rem pause

rem if %pininst%==%pintemp% goto :notfound

call clnutils /c pininst pintemp
if not errorlevel 1 goto :notfound

echo %3 contains strings related to TBS Pro cards.  
echo We strongly recommend that you remove this file from your system.
del /P %3
goto :end

:notfound
rem echo.
rem echo Ok, then let's not worry about this one.

:end
del %temp%\pininst.bat
set pininst=
set pintemp=
goto :out

:1
if not exist "%pinbase%\*.*" goto :out
choice Delete the complete "%pinbase%" folder with all its sub-directories 
if not errorlevel 2 deltree /Y "%pinbase%"
set pinbase=
echo.
goto :out

:2
if not exist "%windir%\Start Menu\Programs\%pingroup%\*.*" goto :out
choice Delete the "%pingroup%" program group 
if not errorlevel 2 deltree /Y "%windir%\Start Menu\Programs\%pingroup%"
set pingroup=
echo.
goto :out

:out